#include<stdlib.h>
#include<stdio.h>
int N,x,y,m,total;

int main(){
    while(scanf("%d",&N),N>0){
        total = x = y = m =  0;
        while(N--){
            scanf("%d %d",&x,&y);
            total += x*(y-m);
            m = y;
        }
        printf("%d miles\n",total);
    }
    return 0;
}
